package com.cloudspace.jindun.sip;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.cloudspace.jindun.activity.dianhua.IncomingCallActivity;
import com.cloudspace.jindun.log.APPLog;

/**
 * Created by zengxianhua on 16/12/17.
 */

public class CallReceiver extends BroadcastReceiver{
    @Override
    public void onReceive(Context context, Intent intent) {
        APPLog.d("zxh", "CallReceiver");
        Intent newIntent = new Intent(context, IncomingCallActivity.class);
        if (!(context instanceof Activity)){
            newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        }

        newIntent.putExtras(intent);

        context.startActivity(newIntent);
    }
}
